//
//  LBReactPatcherModel.h
//  LBReactPatcher
//
//  Created by WuShiHai on 19/5/24.
//  Copyright (c) 2019 Lebbay All rights reserved.
//

#import <Foundation/Foundation.h>

#import <LBDownloader/LBDownloader.h>

/// Foundation Class Type
typedef NS_ENUM (NSUInteger, LBReactPatcherType) {
    LBReactPatcherTypeUnknown = 0,
    LBReactPatcherTypeReactNative = 1,
};

@interface LBReactPatcherModel : NSObject

@property (nonatomic, assign) NSInteger bundleId;

@property (nonatomic, assign) LBReactPatcherType type;

//app类型，1 代表iOS，2 代表Android，其他为未知
@property (nonatomic ,assign) NSInteger appType;

//补丁包业务类型，0 为普通包， 1 为主包， 2 为活动包
@property (nonatomic ,assign) NSInteger bundleType;

@property (nonatomic ,strong) NSString *appIdentifier;

@property (nonatomic ,strong) NSString *appVersion;

@property (nonatomic ,assign) NSInteger mainVersion;

@property (nonatomic ,strong) NSString *moduleName;

@property (nonatomic ,strong) NSString *checkCode;

@property (nonatomic ,strong) NSString *url;

@property (nonatomic, assign) NSInteger state;

/**
 是否启动时候就立即下载，然后加载，该字段不存数据库
 */
@property (nonatomic ,assign) BOOL isLaunchShow;

/**
 isBundleResouce 是否是内置资源包
 */
@property (nonatomic ,assign) BOOL isBundleResouce;


/// 是否需要下载
@property (nonatomic ,assign) BOOL isWillDownlod;

/**
 isBundleResouce 为 YES，bundleModulePath 的目录
 */
@property (nonatomic ,strong) NSString *bundleModulePath;

/**
 补丁包下载后的下载模型
 */
@property (nonatomic, strong) LBDownloaderModel *downloader;

/**
下载进度
*/
@property (nonatomic, assign) CGFloat downloadProgress;

- (BOOL)isValidate;

- (void)setValueFromSqlReuslt:(NSDictionary *)result;

//- (BOOL)isMain;

@end
